package com.fh.feign;

import com.fh.utils.annotation.NeedToken;
import com.fh.utils.annotation.PassToken;
import com.utils.bean.*;
import com.utils.pulc.ResultBody;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.Valid;
import java.util.List;
import java.util.Map;

/**
 * @author whf
 * @date 2023年05月11日 8:58
 */

@FeignClient(path = "demo2", name = "nacos-demo2")
public interface Demo3Feign {

    /**
     * @param safety
     * @return com.utils.pulc.ResultBody<com.utils.bean.User>
     * @description: 登录接口 如果密码正确则会登录并且查出他的信息
     * @author whf
     * @date 2023/5/10 14:21
     */


    @PostMapping("index")
    ResultBody<User> index(@Valid @RequestBody Safety safety);

    /**
     * @param safetyAndUser
     * @description: 注册接口
     * @author whf
     * @date 2023/5/10 15:07
     */

    @PostMapping("setSafetyAndUser")
    ResultBody<Object> setSafetyAndUser(@Valid @RequestBody SafetyAndUser safetyAndUser);

    /**
     * @param substitute
     * @return com.fh.utils.ResultBody<java.lang.Object>
     * @description: 根据登录用户的id 查询权限
     * @author whf
     * @date 2023/4/25 15:03
     */

    @PostMapping("selectAll")
    ResultBody<List<Role>> selectAll(@RequestBody Substitute substitute);

    /**
     * @param substitute
     * @return com.utils.pulc.ResultBody<java.lang.Object>
     * @description: 退出登录
     * @author whf
     * @date 2023/5/10 15:52
     */

    @PostMapping("exit")
    ResultBody<String> exit(@RequestBody Substitute substitute);


    /**
     * @param customerPage
     * @return com.utils.pulc.ResultBody<java.util.List < com.utils.bean.Customer>>
     * @description: 分页查询
     * @author whf
     * @date 2023/5/17 10:07
     */
    @PostMapping("page")
    ResultBody<List<Customer>> getCustomerPage(@Valid @RequestBody CustomerPage customerPage);

    @PostMapping("save")
    ResultBody<Object> save(@RequestBody Customer customer);


    /**
     * @param
     * @return null
     * @description: 对他的ID进行删除
     * @author whf
     * @date 2023/5/17 9:20
     */
    @PostMapping("delCostomer")
    ResultBody<Object> delCostomer(@RequestBody CostomerID id);

    /**
     * @param costomerIDS
     * @return com.utils.pulc.ResultBody<java.lang.Object>
     * @description: 对一群人进行删除
     * @author whf
     * @date 2023/5/17 9:22
     */
    @PostMapping("delCostomers")
    ResultBody<Object> delCostomers(@RequestBody List<CostomerID> costomerIDS);

    /**
     * @param customer
     * @return com.utils.pulc.ResultBody<java.util.List < com.utils.bean.Customer>>
     * @description: 根据条件查询
     * @author whf
     * @date 2023/5/17 10:42
     */
    @PostMapping("getCustomerIF")
    ResultBody<List<Customer>> getCustomerIF(@RequestBody Customer customer);

    /**
     * @description: 将图片传给Demo2 进行处理
     * @author whf
     * @date 2023/5/31 8:59
     * @param multipartFileImag
     * @return com.utils.pulc.ResultBody<java.lang.Object>
     */
    @PostMapping(value = "setMultipartFile",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    ResultBody<String> setMultipartFile(MultipartFileImag multipartFileImag);

    /**
     * @description: 对保存的图片地址进行查询
     * @author whf
     * @date 2023/6/1 15:11
     * @param imagesOrUser
     * @return java.util.List<java.lang.String>
     */
    @PostMapping("getImage")
    ResultBody<List<Photograph>>  getImage(@RequestBody ImagesOrUser imagesOrUser);

    /**
     * @param imagesUpdate
     * @return com.utils.pulc.ResultBody<java.lang.Object>
     * @description: 对图片进行删除
     * @author whf
     * @date 2023/6/1 17:23
     */
    @PostMapping("updateImages")
    public ResultBody<Object> updateImages(@RequestBody ImagesUpdate imagesUpdate);

    @PostMapping("updateMoney")
    public ResultBody<Object> updateMoney(@RequestBody MoneyAll money);
}
